home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / PCXKIT.ARJ / SHOWEGA.PAS < prev    next >
Pascal/Delphi Source File  |  1992-01-06  |  864b  |  38 lines

  1.  
  2. program SHOWEGA;
  3.  
  4. (* Sample implementation of PCX.TPU for EGA. You need to have the Turbo
  5.    .BGI files in the current directory, or change the Initgraph path. Enter
  6.    a filename (without extension) on the command line or, if running under
  7.    Turbo, in the Parameters box. *)
  8.  
  9. uses
  10.   GRAPH,
  11.   CRT,
  12.   PCX;
  13.  
  14. var
  15.   grdriver,
  16.   grmode : integer;
  17.  
  18. BEGIN
  19.   pcxfilename := paramstr(1) + '.PCX';
  20.   grdriver := ega;
  21.   grmode := egahi;    (* 640x350x16 format *)
  22.   initgraph(grdriver, grmode, '');
  23.   setvisualpage(1);                    (* Hide the image *)
  24.   read_pcx_file(grdriver, pcxfilename);
  25.   if file_error then
  26.     begin
  27.       closegraph;
  28.       write('File not found.');
  29.       halt
  30.     end;
  31.   setallpalette(pal);
  32.   setvisualpage(0);                    (* Show the image *)
  33.   repeat
  34.   until (readkey <> #1);
  35.   closegraph
  36. END.
  37.  
  38.